#!/usr/bin/env bash
# 实例文件：dbinit.2
#
DBLIST=$(sh ./listdb | tail -n +2)

PS3="0 inits >"

select DB in $DBLIST
do
    if [ $DB ]
    then
        echo Initializing database: $DB
        
        PS3="$((++j)) inits> "

        mysql -u user -p $DB < myinit.sql
    fi
done
